﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace JBrute
{
   /// <summary>
   /// Interaction logic for MessageDialog.xaml
   /// </summary>
   public partial class MessageDialog : Window
   {
      public static void Show(string message, string title)
      {
         MessageDialog md = new MessageDialog();
         if (String.IsNullOrEmpty(title))
            md.Title = "JBrute Message";
         else
            md.Title = title;
         md.textBoxMessage.Text = message;
         if (Application.Current.MainWindow != null)
         {
            md.Owner = Application.Current.MainWindow;
            md.ShowDialog();
         }
         else
            MessageBox.Show(message, title);
      }
      public MessageDialog()
      {
         InitializeComponent();
      }

      private void Window_Loaded(object sender, RoutedEventArgs e)
      {
         System.Media.SystemSounds.Beep.Play();
      }
   }
}
